<?php

include_once 'db/Crud.php';

class Serie extends Crud {
    protected $table = "serie";
    private $nome;
    private $status;
    
    public function getNome() {
        return $this->nome;
    }

    public function getStatus() {
        return $this->status;
    }

    public function setNome($nome) {
        $this->nome = $nome;
    }

    public function setStatus($status) {
        $this->status = $status;
    }

    

    public function insert() {
        $sql = "INSERT INTO $this->table (ser_nome, ser_status) VALUES (:nome, :status)";
        $stmt = Db::prepare($sql);
        $stmt->bindParam(':nome', $this->nome);
        $stmt->bindParam(':status', $this->status);
        return $stmt->execute();
        
    }

    public function update($id) {
        $sql = "UPDATE $this->table SET ser_nome = :nome, ser_status = :status WHERE id = :id";
        $stmt = Db::prepare($sql);
        $stmt->bindParam(':nome', $this->nome);
        $stmt->bindParam(':status', $this->status);
        $stmt->bindParam(':id', $id);
        return $stmt->execute();
        
    }


}
